public class Room {
    //私有成员变量
    private String id;
    private double area;
    private String type;
    private double price;
    private boolean state;
    //空构造方法
    public Room(){};
    //第二个构造方法
    public Room(String x, double y, double z)
    {
        this.id = x;
        this.area = y;
        this.price = z;
    }
    //第三个构造方法
    public Room(String p, double q, String s, double m, boolean n)
    {
        this.id = p;
        this.area = q;
        this.type = s;
        this.price = m;
        this.state = n;
    }
    //输出成员变量
    public void showRoom()
    {
        System.out.println("房间编号：" + this.id);
        System.out.println("房间面积：" + this.area);
        System.out.println("房间价格：" + this.price);
        if(this.state)
            System.out.println("这间房间正处于售出");
        else
            System.out.println("这间房间正处于待售");
    }
    public void setState()
    {
        this.state = !(this.state);
    }
    public double getArea()
    {
        return this.area;
    }
    public double getPrice()
    {
        return this.price * this.area;
    }
    public static void main(String[] args) {
        Room roomA = new Room("3-2-502", 113.5, "三室一厅", 15000.0, false);
        Room roomB = new Room("4-5-1108", 156.9, "四室二厅", 17500.0, true);
         Room roomC = new Room("4-3-1501", 45.9, "二室一厅", 16200.0, true);
         //总面积
        System.out.println("三个房间的总面积：");
        System.out.println((roomA.getArea()+roomB.getArea()+roomC.getArea()));
         //总价
        System.out.println("三个房间的总价格：");
        System.out.println((roomA.getPrice()+roomB.getPrice()+roomC.getPrice()));

        roomA.setState();
        //show
        roomA.showRoom();
        roomB.showRoom();
        roomC.showRoom();

    }
}
